/* XNeeti HRMS application styles: the page shell and the hover text.

   Loaded after the Innovaccer Design System stylesheet
   (static/vendor/innovaccer-design-system/index.css). Every page is built from
   the design system's components, its Row and Column grid and its utilities,
   and uses no class from this file. What is here is what the library has no
   class for: the sidebar's position, the menu on a narrow screen, the width of
   the content, one rule for links that carry its Button or its ActionCard, and
   the text shown on hover for an element with a data-tip attribute.

   Every value below is one of the design system's tokens. Classes start with
   "Hrms-". */

:root {
  /* The design system names one family and no fallback. */
  --font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* The library's Button is a <button> and its ActionCard a <div>. A page that
   navigates uses a link, and a link is underlined and coloured unless told
   otherwise. The ActionCard keeps the colour of the text it holds. */
a.Button,
a.ActionCard {
  text-decoration: none;
}

a.ActionCard {
  color: inherit;
}

/* Hover text. The design system's Tooltip is placed by JavaScript, which these
   pages do not load. An element with a data-tip attribute shows that text
   above itself, in the Tooltip's colours and spacing, while the pointer is over
   it. No class is involved, so a page still uses the design system's classes
   only. data-tip-align="end" lines the text up with the element's right edge,
   for an element near the right-hand side of a scrolling container. */
[data-tip] {
  position: relative;
}

[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + var(--spacing-10));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  padding: var(--spacing-10) var(--spacing-20);
  border-radius: var(--border-radius-10);
  background: var(--inverse);
  color: var(--white);
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-normal);
  line-height: var(--font-height-s);
  white-space: nowrap;
  pointer-events: none;
}

[data-tip][data-tip-align="end"]:hover::after {
  left: auto;
  right: 0;
  transform: none;
}

.Hrms-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.Hrms-side {
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--white);
  /* A shadow, not a border: the navigation is exactly 240px wide, and a border
     would take one pixel of it. */
  box-shadow: inset calc(-1 * var(--border-width-2-5)) 0 0 var(--secondary-light);
}

.Hrms-sideTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-30) var(--spacing-40);
}

.Hrms-brand {
  text-decoration: none;
}

.Hrms-brand:focus-visible {
  outline: var(--border-width-05) solid var(--primary-focus);
  outline-offset: var(--spacing-05);
  border-radius: var(--border-radius-10);
}

.Hrms-navToggle {
  display: none;
}

.Hrms-sideFoot {
  margin-top: auto;
  padding: var(--spacing-30) var(--spacing-40);
  border-top: var(--border-width-2-5) solid var(--secondary-light);
}

.Hrms-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Padding comes from a design-system utility on the element (p-6 or p-4). */
.Hrms-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 1280px;
}

/* Below the design system's medium breakpoint the sidebar becomes a bar
   across the top, and the menu opens from a button. */
@media (max-width: 767px) {
  .Hrms-shell {
    display: block;
  }

  .Hrms-side {
    position: static;
    height: auto;
    box-shadow: inset 0 calc(-1 * var(--border-width-2-5)) 0 var(--secondary-light);
  }

  .Hrms-navToggle {
    display: flex;
  }

  .Hrms-side:not(.is-open) .Hrms-nav,
  .Hrms-side:not(.is-open) .Hrms-sideFoot {
    display: none;
  }

  /* The design system fixes the navigation at 240px. On a narrow screen it
     takes the full width. */
  .Hrms-nav.VerticalNav--expanded {
    width: 100%;
    padding-bottom: var(--spacing-20);
  }

  .Hrms-nav .MenuItem {
    width: auto;
  }
}
