/* EDO Business R137 — desktop sidebar viewport fit + responsive login.
 * Does not modify React markup, navigation events, authentication, or mobile dashboard.
 * Loaded AFTER the existing R133/R136 CSS links to avoid modifying 3 copied bundles.
 */
@media (min-width: 961px) {
  /* R127 height:100dvh + R65 margin:8px/8px exceeded the viewport.
     Keep the rounded sidebar fully inside the visual viewport. */
  html body #root > .app-shell > aside.sidebar,
  html body #root > .app-shell > .sidebar {
    box-sizing: border-box !important;
    top: 10px !important;
    margin: 10px 0 10px 8px !important;
    height: calc(100vh - 20px) !important;
    height: calc(100dvh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    /* R136 owns the 24px border radius. */
  }
  html body #root > .app-shell > .sidebar > .sidebar-inner {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain;
  }
  /* Only the authentication main has an immediate form child and h2.
     No .app-shell = no effect on dashboard/PDF/admin components. */
  html body:has(#root > main > form > h2) {
    min-width: 0 !important;
    overflow-x: hidden;
  }
  html body #root:has(> main > form > h2) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 100dvh !important;
  }
  html body #root > main:has(> form > h2) {
    box-sizing: border-box !important;
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    padding: clamp(28px, 4vw, 76px) !important;
    place-items: center !important;
    background:
      radial-gradient(circle at 10% 12%, rgba(107, 68, 243, .16), transparent 34%),
      radial-gradient(circle at 90% 85%, rgba(65, 112, 219, .12), transparent 38%),
      #f3f6fc !important;
  }
  html body #root > main:has(> form > h2) > form {
    box-sizing: border-box !important;
    width: min(100%, 480px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: clamp(28px, 3vw, 44px) !important;
    gap: 16px !important;
    border: 1px solid #e5eafb !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 65px rgba(27, 44, 90, .11) !important;
    background: #fff !important;
  }
  html body #root > main:has(> form > h2) > form > h2 {
    font-size: clamp(23px, 2vw, 29px) !important;
    line-height: 1.25 !important;
    letter-spacing: -.035em;
    color: #10214b;
    overflow-wrap: anywhere;
  }
  html body #root > main:has(> form > h2) > form > input {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 15px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
  }
  html body #root > main:has(> form > h2) > form > button {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 48px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
  }
}
@media (min-width: 1200px) {
  /* Give desktop sign-in an actual desktop-sized brand pane + login pane. */
  html body #root > main:has(> form > h2) {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px) !important;
    column-gap: clamp(40px, 6vw, 115px) !important;
    max-width: none !important;
    justify-content: center !important;
  }
  html body #root > main:has(> form > h2)::before {
    content: 'EDO Business' !important;
    box-sizing: border-box;
    grid-column: 1;
    grid-row: 1;
    display: grid;
    place-items: center;
    align-self: stretch;
    width: 100%;
    min-height: min(610px, 70dvh);
    padding: 48px 30px;
    border-radius: 30px;
    background:
      radial-gradient(circle at 75% 17%, rgba(158, 131, 255, .35), transparent 29%),
      linear-gradient(145deg, #081431 2%, #122357 60%, #2e238a 100%);
    color: #fff;
    font: 800 clamp(32px, 3.5vw, 56px)/1.2 Inter, system-ui, sans-serif;
    letter-spacing: -.035em;
    text-align: center;
    box-shadow: 0 25px 65px rgba(11, 28, 80, .16);
  }
  html body #root > main:has(> form > h2) > form {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: 520px !important;
  }
}
/* Very short desktop windows: form and sidebar remain usable without clipping. */
@media (min-width: 961px) and (max-height: 650px) {
  html body #root > main:has(> form > h2) {
    min-height: 100dvh !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }
  html body #root > main:has(> form > h2) > form {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
    gap: 10px !important;
  }
}
