/* =============================================================================
   kendo2022-compat.css

   Purpose: bridge the Kendo UI 2018 -> 2022 "unified rendering" state-class
   rename for pages that are served the Kendo 2022 bundle by the page-split
   layout logic (see _RootLayout.cshtml / _StartupRootLayout.cshtml).

   Kendo 2022 renamed the state classes:
     k-state-active   -> k-active
     k-state-hover    -> k-hover
     k-state-selected -> k-selected
     k-state-disabled -> k-disabled
     k-state-hidden   -> k-hidden
   and the 2022 theme (kendo.default-ocean-blue.min.css) no longer defines any
   .k-state-* rules at all.

   Some views still hand-roll a kendoTabStrip and emit the OLD 2018 state class
   on the server (via the RenderSelectedTabIndex / LocalizedEditor helpers).
   When such a tabstrip renders inside a page that also has a grid, that page is
   served the Kendo 2022 bundle, so the server-emitted 2018 classes would carry
   no styling until the widget's JS re-renders. This file maps ONLY the state
   classes those hand-rolled tabstrips (and the localized-editor tabstrip)
   actually emit, onto their 2022 twins, so the initial server render is styled
   correctly.

   Scope is intentionally minimal (no speculative styling). Loaded ONLY on
   Kendo 2022 pages.

   John - 06/07/2026
   ============================================================================= */

/* Active tab item: server render emits k-state-active; 2022 theme styles
   .k-item.k-active. Treat the old class as the new one within a tabstrip. */
.k-tabstrip .k-item.k-state-active {
    /* mirror k-active: the selected tab sits "on top" of the content panel */
    border-bottom-color: transparent;
}

.k-tabstrip-bottom > .k-tabstrip-items-wrapper .k-item.k-state-active {
    border-top-color: transparent;
}

.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-state-active {
    border-right-color: transparent;
}

.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-state-active {
    border-left-color: transparent;
}

/* Tab content panel: 2018 marked the visible pane with k-state-active,
   2022 uses k-active. Keep the old class showing its pane. */
.k-tabstrip > .k-content.k-state-active,
.k-tabstrip-content.k-state-active {
    display: block;
}

/* Localized-editor "Standard" tab is emitted hidden with k-state-hidden. */
.k-tabstrip .k-item.k-state-hidden {
    display: none !important;
}

/* Hover / selected / disabled twins for tab items (runtime states). */
.k-tabstrip .k-item.k-state-hover {
    /* map to k-hover hover treatment */
    color: inherit;
}

.k-tabstrip .k-item.k-state-selected {
    /* map to k-selected */
    border-bottom-color: transparent;
}

.k-tabstrip .k-item.k-state-disabled {
    /* map to k-disabled */
    opacity: 0.6;
    pointer-events: none;
}

/* =============================================================================
   RTL grid text alignment (added in v=1.1)

   The Kendo 2022 theme (kendo.default-ocean-blue.min.css) HARDCODES
   text-align:left on `.k-table` and on `.k-grid thead/tbody/tfoot`.
   The 2018 theme did not, so under <html dir="rtl"> cells used to inherit the
   RTL direction and align right naturally. On 2022 pages that hardcoded left
   won over the inherited direction, so Arabic grid content (e.g.
   /hr/job/list, /hr/religion/list, /hr/nationality/list) rendered
   left-aligned.

   Force right alignment for grids/tables under RTL. Per-column inline styles
   (centered / numeric columns) still win over these rules.

   John - 06/07/2026
   ============================================================================= */
[dir="rtl"] .k-grid thead,
[dir="rtl"] .k-grid tbody,
[dir="rtl"] .k-grid tfoot,
[dir="rtl"] .k-table,
.k-rtl .k-grid thead,
.k-rtl .k-grid tbody,
.k-rtl .k-grid tfoot,
.k-rtl .k-table {
    text-align: right;
}

/* =============================================================================
   R1 — Grid template link cells look like plain text (added in v=1.2)

   Grid cell templates emit plain anchors, e.g. in Areas/HR/Views/Job/List.cshtml
   and Employee/List.cshtml:  Template = "<a href=\"Edit/#=Id#\">#=Name#</a>".
   Under the Kendo 2018 stack these inherited Bootstrap's link colour and looked
   like classic blue clickable links. The 2022 theme
   (kendo.default-ocean-blue.min.css) introduced:
       .k-grid a{color:inherit;text-decoration:none}
       .k-grid a:hover{text-decoration:none}
   so those anchors now inherit the dark cell text colour and read as plain text.

   Restore the 2018/Bootstrap link appearance for anchors inside grid DATA cells
   only. Colours copied verbatim from
   Administration/bootstrap/css/bootstrap.min.css:
       a{color:#337ab7;text-decoration:none}
       a:focus,a:hover{color:#23527c;text-decoration:underline}
   The edit/delete command buttons that grids also emit
   (KendoGridExtensions.cs: <a class="btn btn-sm btn-default"> and
   <button class="btn btn-sm btn-danger">) are Bootstrap .btn and are excluded,
   as are any Kendo buttons/links, so only real content links are affected.

   John - 06/07/2026
   ============================================================================= */
.k-grid td a:not(.btn):not(.k-button):not(.k-link) {
    /* bootstrap.min.css -> a{color:#337ab7} */
    color: #337ab7;
}

.k-grid td a:not(.btn):not(.k-button):not(.k-link):hover,
.k-grid td a:not(.btn):not(.k-button):not(.k-link):focus {
    /* bootstrap.min.css -> a:focus,a:hover{color:#23527c;text-decoration:underline} */
    color: #23527c;
    text-decoration: underline;
}

/* =============================================================================
   R2 — Vertical tabstrip skin lost under 2022 (added in v=1.2)

   Employee create/edit builds a vertical tabstrip with
   $("#Tabs").kendoTabStrip({ tabPosition:'left' })  -> .k-tabstrip-left, and
   CompanyPolicy (_SettingsTapsPartial) uses tabPosition:'right'
   -> .k-tabstrip-right. The 2022 ocean-blue theme renders tab items and the
   content pane with transparent borders/background (flat), losing the 2018
   "connected tab" look.

   Port the 2018 SKIN (colours/borders/bg only; the 2022 flex layout + radii are
   kept) from Content/kendo/2018.1.503/kendo.custom.min.css, scoped to VERTICAL
   tabstrips only so horizontal tabstrips and other 2022 widgets stay native.
   Source rules (kendo.custom.min.css):
     item (default): .k-tabstrip-items .k-item{background:transparent;border-color:transparent}
     default link  : .k-tabstrip-items .k-state-default .k-link{color:#364150}
     hover         : .k-tabstrip-items .k-item.k-state-hover{background:#ebebeb}
                     .k-tabstrip-items .k-state-hover{border-color:#aeaeae}
                     .k-tabstrip-items .k-state-hover .k-link{color:#333333}
     active        : .k-tabstrip-items .k-item.k-state-active{background:#ffffff}
                     .k-tabstrip-items .k-state-active{border-color:#cccccc}
                     .k-tabstrip-items .k-state-active .k-link{color:#333333}
     content pane  : .k-tabstrip .k-content.k-state-active{background-color:#ffffff;color:#333333}
                     + border-color:#cccccc (grouped .k-content rule in kendo.custom.min.css)
   Under the 2022 bundle the live runtime state class is .k-active / .k-hover
   (the .k-state-active twins are already mapped at the top of this file for the
   server-rendered pass).

   John - 06/07/2026
   ============================================================================= */

/* Inactive tab items: flat / transparent (2018 .k-item base) */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item {
    background-color: transparent;
    border-color: transparent;
}

/* Default tab link colour (2018: #364150) */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item > .k-link,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item > .k-link {
    color: #364150;
}

/* Hover (2018: bg #ebebeb, border #aeaeae, link #333) — not the active tab */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-hover:not(.k-active),
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item:hover:not(.k-active),
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-hover:not(.k-active),
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item:hover:not(.k-active) {
    background-color: #ebebeb;
    border-color: #aeaeae;
    color: #333333;
}

.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-hover:not(.k-active) > .k-link,
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item:hover:not(.k-active) > .k-link,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-hover:not(.k-active) > .k-link,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item:hover:not(.k-active) > .k-link {
    color: #333333;
}

/* Active/selected tab (2018: white bg, #cccccc border, #333 link) */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-active,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-active {
    background-color: #ffffff;
    border-color: #cccccc;
    color: #333333;
}

.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-active > .k-link,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-active > .k-link {
    color: #333333;
}

/* Re-assert the tab-facing side as transparent (our border-color shorthand above
   would otherwise fill it) so the active tab stays connected to the content pane,
   mirroring the 2022 theme's own .k-item.k-active border-*-color:transparent. */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item.k-active {
    border-right-color: transparent;
}

.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item.k-active {
    border-left-color: transparent;
}

/* Content pane (2018: white bg, #cccccc 1px border, #333 text). The theme keeps
   the tab-facing side transparent via !important, so the pane stays connected. */
.k-tabstrip-left > .k-content,
.k-tabstrip-left > .k-tabstrip-content,
.k-tabstrip-right > .k-content,
.k-tabstrip-right > .k-tabstrip-content {
    background-color: #ffffff;
    border-color: #cccccc;
    color: #333333;
}

/* =============================================================================
   R3 — Grid/filter/search Kendo buttons render solid/heavy under 2022 (v=1.2)

   The Kendo buttons in grid/filter/search contexts regressed:
     - the between-date search button rendered by KendoGridExtensions.cs as
       <button id='applySearch' class='k-button'> (inside #KendoGrid-between),
     - the grid filter-row cell buttons (.k-filtercell),
     - the grid filter-menu Apply/Clear buttons (.k-filter-menu; the Apply button
       text is the filter.keys.buttons.search resource).
   Under the 2022 ocean-blue theme a bare .k-button is transparent with a 1px
   solid inherited border and no hover (looks "solid border, no hover"), while the
   filter Apply button is .k-button-solid-primary (solid #1274ac fill).

   Restore the 2018 button skin from Content/kendo/2018.1.503/kendo.custom.min.css,
   scoped to grid/filter/search containers only. Bootstrap .btn command buttons
   (edit/delete) are NOT matched (they are .btn, not .k-button). Source rules:
     .k-button{color:#333333;border-color:#cccccc;background-color:#ffffff}
     .k-button:hover,.k-button.k-state-hover{color:#333333;border-color:#aeaeae;background-color:#ebebeb}
     .k-primary{color:#ffffff;border-color:#2c3541;background-color:#364150}
     .k-primary:hover,.k-primary.k-state-hover{color:#ffffff;border-color:#13171c;background-color:#262d38}

   John - 06/07/2026
   ============================================================================= */

/* Regular (non-primary) Kendo buttons -> 2018 subtle flat-white */
.k-grid .k-button,
.k-filtercell .k-button,
.k-filter-menu .k-button,
#KendoGrid-between .k-button {
    color: #333333;
    border-color: #cccccc;
    background-color: #ffffff;
    background-image: none;
}

.k-grid .k-button.k-hover,
.k-grid .k-button:hover,
.k-filtercell .k-button.k-hover,
.k-filtercell .k-button:hover,
.k-filter-menu .k-button.k-hover,
.k-filter-menu .k-button:hover,
#KendoGrid-between .k-button.k-hover,
#KendoGrid-between .k-button:hover {
    color: #333333;
    border-color: #aeaeae;
    background-color: #ebebeb;
}

/* Primary / Apply (search) button stays distinguished -> 2018 .k-primary dark slate.
   2022 uses .k-button-solid-primary; older markup uses .k-primary — cover both.
   Written after the subtle rule so the primary skin wins on the Apply button. */
.k-grid .k-button-solid-primary,
.k-grid .k-button.k-primary,
.k-filter-menu .k-button-solid-primary,
.k-filter-menu .k-button.k-primary {
    color: #ffffff;
    border-color: #2c3541;
    background-color: #364150;
    background-image: none;
}

.k-grid .k-button-solid-primary.k-hover,
.k-grid .k-button-solid-primary:hover,
.k-grid .k-button.k-primary:hover,
.k-filter-menu .k-button-solid-primary.k-hover,
.k-filter-menu .k-button-solid-primary:hover,
.k-filter-menu .k-button.k-primary:hover {
    color: #ffffff;
    border-color: #13171c;
    background-color: #262d38;
}

/* =============================================================================
   R2b — Vertical tab ITEM content, per John's spec (added in v=1.3):
   old (Kendo 2018) vertical tabs showed the tab text NOT styled as a link,
   always on ONE LINE, with an ICON beside the text (views emit
   <i class="fa fa-..."></i> + text inside each tab item — e.g.
   Employee/_CreateOrUpdate.cshtml lines 93-141; Kendo wraps that into .k-link).

   - text-decoration:none — tab text must never look like a hyperlink
     (also shields tabs from any global anchor styling; the R1 grid-link rule
     already excludes .k-link).
   - white-space:nowrap + width:auto — Kendo 2022 sets vertical tab items to
     white-space:normal, which wraps Arabic labels to multiple lines and
     collapses the tab column (same problem CLAUDE.md §4 records); nowrap
     restores the 2018 one-line tabs for BOTH languages (this file loads on
     every page, unlike style-custom.rtl.css which is RTL-only).
   - margin-inline-end on the icon — keeps the icon beside the text with the
     2018-style gap; the logical property flips automatically under dir="rtl".

   John - 06/07/2026
   ============================================================================= */
.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item {
    white-space: nowrap;
    width: auto;
}

.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item .k-link,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item .k-link {
    text-decoration: none;
    white-space: nowrap;
}

.k-tabstrip-left > .k-tabstrip-items-wrapper .k-item .k-link > i,
.k-tabstrip-right > .k-tabstrip-items-wrapper .k-item .k-link > i {
    margin-inline-end: 6px;
}

/* =============================================================================
   R4 — Disabled CheckBoxControlFor checkboxes show TWO ticks under 2022 (v=1.4)

   Markup (HtmlExtensions.CheckBoxControlFor, used e.g. for IsManager /
   IsManagementManager in Employee _CreateOrUpdate.WorkInfo):
     <label class="mt-checkbox mt-checkbox-outline">
       <input type="checkbox" checked disabled class="form-control">
       <input type="hidden" ...>            (posts the value when disabled)
       <span></span>                        (Metronic draws box + tick via span:after)
       Label text
     </label>
   Metronic (components.css / components-rtl.min.css) hides the native input
   (.mt-checkbox > input { position:absolute; z-index:-1; opacity:0 }) and draws
   ONE tick via `input:checked ~ span:after`. Under the Kendo 2022 stack a second
   tick appeared on disabled checkboxes — either the native input being re-shown
   by a competing rule, or a stray pseudo-element tick on the span. Defensive fix
   covers both, scoped strictly to Metronic checkbox labels:
   - re-assert the native input as invisible with !important (kills a re-shown
     native tick regardless of which rule un-hid it);
   - forbid span::before content (Metronic only ever uses span::after for the
     tick, so ::before content here can only be a stray duplicate).
   No effect on enabled checkboxes' behaviour — the input stays clickable via the
   label exactly as Metronic designed.

   John - 06/07/2026
   ============================================================================= */
.mt-checkbox > input[type="checkbox"] {
    position: absolute !important;
    z-index: -1 !important;
    opacity: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 1px;
}

.mt-checkbox > span::before {
    content: none !important;
}

/* =============================================================================
   R5 — Tabstrip panel background + shadow (added in v=1.5, per John's request)

   The old (2018-era) tabstrips read as a raised white panel; the 2022 flat
   theme dropped that. No extractable shadow rule exists in the 2018 css (the
   effect came from the overall panel composition), so this is a deliberate,
   tunable approximation: white panel + soft shadow, applied to the whole
   tabstrip (vertical AND horizontal keep consistent depth).
   Adjust the rgba/blur here if John wants it stronger/softer.

   John - 06/07/2026
   ============================================================================= */
.k-tabstrip {
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   R6 — Round borders on grid/filter/search Kendo buttons (added in v=1.5)

   Old 2018 buttons carried a 4px radius (kendo.common.min.css button groups:
   .k-button-wrap{border-radius:4px}, .k-buttons-horizontal :first-child
   {border-radius:4px 0 0 4px}). The 2022 ocean-blue default is squarer;
   restore the rounded 2018 feel on the same button scope styled by R3.

   John - 06/07/2026
   ============================================================================= */
.k-grid .k-button,
.k-filtercell .k-button,
.k-filter-menu .k-button,
#KendoGrid-between .k-button {
    border-radius: 4px;
}

/* =============================================================================
   R7 — RTL: widget text/chips must start from the RIGHT edge (added in v=1.5)

   Under Arabic (dir=rtl) the 2022 flex-based inputs left visual gaps:
   - MultiSelect chips/input (e.g. branches on CreateWeekEndAlterAdvanced)
     started away from the right edge;
   - DropDownList value text (e.g. DocumentTypeId on employee document
     create/edit) did not start at the right edge.
   flex-start under dir=rtl = the RIGHT side, and inputs/text get explicit
   right alignment. Per-column inline styles still win.

   John - 06/07/2026
   ============================================================================= */
[dir="rtl"] .k-multiselect .k-chip-list,
[dir="rtl"] .k-multiselect .k-input-values {
    justify-content: flex-start;
}

[dir="rtl"] .k-picker .k-input-inner,
[dir="rtl"] .k-input .k-input-inner,
[dir="rtl"] .k-picker .k-input-value-text,
[dir="rtl"] .k-input .k-input-value-text {
    text-align: right;
}

/* =============================================================================
   R8 — Bootstrap-3 input-groups containing Kendo 2022 widgets (added in v=1.6)

   The ControlFor(Icon:...) helper and the DateTime editor templates wrap the
   widget in <div class="input-group">widget<span class="input-group-addon">.
   Bootstrap 3 lays input-groups out as display:table + table-cells and relied
   on the 2018 widget wrapper behaving as a cell. The 2022 widget roots are
   inline-flex and take width:100%, so the addon icons wrapped to extra lines
   and the group grew tall (e.g. من تاريخ / الى تاريخ on
   /Accounting/Finance/CreateYear).

   Switch ONLY input-groups that actually contain a 2022 kendo widget to
   flexbox (:has() — supported by all 2023+ browsers): widget flexes to fill,
   addons stay beside it on one line. RTL order follows dir automatically.

   John - 07/07/2026
   ============================================================================= */
.input-group:has(> .k-datepicker),
.input-group:has(> .k-timepicker),
.input-group:has(> .k-datetimepicker),
.input-group:has(> .k-numerictextbox),
.input-group:has(> .k-picker) {
    display: flex;
    align-items: stretch;
}

.input-group:has(> .k-datepicker) > .input-group-addon,
.input-group:has(> .k-timepicker) > .input-group-addon,
.input-group:has(> .k-datetimepicker) > .input-group-addon,
.input-group:has(> .k-numerictextbox) > .input-group-addon,
.input-group:has(> .k-picker) > .input-group-addon {
    display: inline-flex;
    align-items: center;
    width: auto;
}

.input-group > .k-datepicker,
.input-group > .k-timepicker,
.input-group > .k-datetimepicker,
.input-group > .k-numerictextbox,
.input-group > .k-picker {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
