/* ============================================================================
   Kabstour UI — phone-first additions
   ----------------------------------------------------------------------------
   Loaded after portal.css. Holds the pieces taken from the client's dashboard
   mockup (4 Nov 2026) that the existing design system did not have.

   Brand colours are NOT redefined here: the tokens in portal.css stay the
   single source of truth, so the brand cannot drift between files.
   ========================================================================= */

:root {
  --kp-tabbar-height: 62px;
}

/* ─── BOTTOM TAB BAR (phones and small tablets) ────────────────────────────
   The product is used on phones, where the side menu is behind a button and
   a worker could get stranded on a page with no way back. This bar is always
   there. It is hidden from 992px up, where the side menu is on screen. */

.kp-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--kp-border, #E6E8EE);
  box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.06);
}

.kp-tabbar-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 4px 2px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--kp-text-muted, #6A7085);
  font-family: var(--kp-font, inherit);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.kp-tabbar-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kp-tabbar-item:hover,
.kp-tabbar-item:focus-visible {
  color: var(--kp-primary);
  background: var(--kp-primary-light, #FDECE9);
}

/* The page you are on. */
.kp-tabbar-item[aria-current="page"] {
  color: var(--kp-primary);
}

/* The small dot that says there is something waiting. */
.kp-tabbar-flag {
  position: absolute;
  top: 6px;
  right: 26%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E8A317;
}

/* Keep the bar off the last thing on the page. */
body.kp-has-tabbar {
  padding-bottom: calc(var(--kp-tabbar-height) + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 992px) {
  .kp-tabbar { display: none; }
  body.kp-has-tabbar { padding-bottom: 0 !important; }
}

/* ─── TAPPABLE ROW ─────────────────────────────────────────────────────────
   A line of text with an icon and a chevron that takes you somewhere. The
   mockup uses these for the profile steps and the saved CV, in place of a
   bulleted list that looked like text but was meant to be tapped. */

.kp-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--kp-border, #E6E8EE);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  min-height: 48px;
}

.kp-row-link:hover,
.kp-row-link:focus-visible {
  border-color: var(--kp-primary);
  color: inherit;
}

.kp-row-link-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--kp-primary-light, #FDECE9);
  color: var(--kp-primary);
}

.kp-row-link-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.kp-row-link-body { flex: 1; min-width: 0; }
.kp-row-link-title { font-weight: 600; font-size: 14px; }
.kp-row-link-sub { font-size: 12px; color: var(--kp-text-muted, #6A7085); }
.kp-row-link-chevron { flex-shrink: 0; color: var(--kp-text-muted, #6A7085); }

/* ─── NOTICE STRIP ─────────────────────────────────────────────────────────
   The amber "Verify your address" band from the mockup: something the user
   must do before a part of the product will work. */

.kp-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #F3D9A4;
  border-radius: 12px;
  background: #FFF4DC;
  color: #7A5B14;
  text-decoration: none;
}

.kp-notice:hover { border-color: #E8A317; color: #7A5B14; }
.kp-notice-title { font-weight: 700; font-size: 14px; }
.kp-notice-sub { font-size: 12px; opacity: .85; }

/* ─── QUICK ACTION GRID ────────────────────────────────────────────────────
   Four stacked full-width buttons became a two-by-two grid of tiles, which
   is faster to read and far easier to hit with a thumb. */

.kp-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kp-action-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  border: 1px solid var(--kp-border, #E6E8EE);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  min-height: 92px;
}

.kp-action-tile:hover,
.kp-action-tile:focus-visible {
  border-color: var(--kp-primary);
  color: inherit;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
}

.kp-action-tile svg { width: 22px; height: 22px; stroke: var(--kp-primary); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kp-action-tile-label { font-weight: 600; font-size: 14px; line-height: 1.25; }

/* ─── COMPLETENESS RING ────────────────────────────────────────────────────
   Replaces the flat bar. The number is the point, so it sits in the middle. */

.kp-ring {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--kp-primary) calc(var(--kp-ring-value, 0) * 1%), #EDEFF4 0);
}

.kp-ring-hole {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #fff;
  font-weight: 700;
  font-size: 18px;
}

.kp-ring-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ─── TOP BAR ON SMALL SCREENS ─────────────────────────────────────────────
   On a phone the header row wrapped onto a second line and the brand image,
   52px tall inside an 18px wrapper, spilled over the buttons that had landed
   underneath it. Measured at 390px: logo, role pill, spacer and actions came
   to more than the row could hold.

   One row, a brand sized for the screen, and a role pill allowed to shrink. */

@media (max-width: 991.98px) {
  .nav-container {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  /* The white plate the brand sits on.

     "height: auto" is the whole point of this rule. The template stylesheet
     carries

       @media (min-width: 300px) and (max-width: 991.98px) {
         .navbar-area .nav-container .logo-wrapper { height: 18px; }
       }

     which is three classes deep and so beat the plain .logo-wrapper in
     refine.css. The plate was pinned to 18px on every screen under 992px
     while the logo inside it was 32px (phone) or 38px (tablet), so the gold
     lockup hung out of its own white box, above and below. Measured at
     390px: plate 18px, logo 32px. That is the "logo is wrong in mobile mode"
     the client reported on 7 Nov 2026, and it was on every page, not only
     the login screen. Desktop was never affected: the template rule stops at
     991.98px, which is why this looked fine on a laptop. */
  .navbar-area .nav-container .logo-wrapper,
  .logo-wrapper {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    height: auto !important;
  }

  .kabs-brand-logo {
    height: 38px !important;
  }

  .kp-rolesw {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .kp-navbar-actions {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
}

@media (max-width: 430px) {
  .kabs-brand-logo { height: 32px !important; }

  /* Two grid buttons sat side by side. On a narrow screen the services
     switcher gives way; it is in the full menu, which the bar below opens. */
  .kp-cube-group .kp-service-switcher,
  .kp-cube-group .kp-services-btn { display: none !important; }
}

/* ─── SERVICES DROPDOWN POSITION ───────────────────────────────────────────
   The panel is 340px wide, anchored left:0 to a button that sits near the
   right edge of the header, and hidden with visibility rather than display.
   A hidden box still counts towards the page width, so every page scrolled
   sideways — measured at 1440px: 1575px of scroll width, all of it this
   panel hanging past the edge.

   Anchoring it to the right keeps it on screen when open and stops it
   widening the page when closed. */

.kp-switcher-panel {
  left: auto !important;
  right: 0 !important;
}
